@echo off
echo ========================================
echo 测试后端服务连接
echo Testing Backend Connection
echo ========================================
echo.
echo 等待3秒...
timeout /t 3 /nobreak >nul

powershell -Command "try { $response = Invoke-RestMethod -Uri 'http://localhost:8080' -Method Get; Write-Host '服务状态:' -ForegroundColor Green; $response | ConvertTo-Json; Write-Host ''; Write-Host '测试API健康检查...' -ForegroundColor Green; $apiHealth = Invoke-RestMethod -Uri 'http://localhost:8080/api/health' -Method Get; $apiHealth | ConvertTo-Json } catch { Write-Host '连接失败！请确保后端服务已启动。' -ForegroundColor Red; Write-Host $_.Exception.Message -ForegroundColor Red }"

echo.
pause

